object Practise3 {
  def transformList(numbers: List[Int]): List[Int] = {
    numbers.map { num =>
      if (num % 2 == 0) num / 2  // 如果是偶数，转换为它的一半
      else num + 1                // 如果是奇数，加1
    }
  }

  def main(args: Array[String]): Unit = {
    val numbers = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    val transformedList = transformList(numbers)
    println(s"原始列表: $numbers")
    println(s"转换后的列表: $transformedList")
  }
}